import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import '../score/mine_my_score_page.dart';
import 'integral_stat_tab_item_page.dart';

class IntegralStatTabPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _IntegralStatTabPageState();
  }
}

class _IntegralStatTabPageState extends State<IntegralStatTabPage>
    with SingleTickerProviderStateMixin {
  TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = new TabController(length: 3, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("积分排行榜"),
        bottom: TabBar(
          indicatorColor: Colors.red,
          controller: _tabController,
          tabs: [Tab(text: "全矿排行"), Tab(text: "部门排行"), Tab(text: "部门分类排行")],
        ),
      ),
      body: TabBarView(
        controller: _tabController,
        children: [
          IntegralStatTabItemPage(
            tabType: '',
          ),
          MyScorePage(
            scoreRankType: ScoreRankType.integralStatistics,
          ),
          MyScorePage(
            scoreRankType: ScoreRankType.integralStatistics,
          ),
        ],
      ),
    );
  }
}
